const {getTransactions, getTransaction} = require('../controllers');
const {postMethodAccess, getMethodAccess} = require("../controllers/track")
const commonResponse = {
    type: 'object',
    properties: {
        data: {
            type: 'object',
            properties:{
                id:{
                    type:'string'
                }
            }
        },
        message:{type: 'string'},
        code:{type: 'number'}
    }
}
const trackAccessGet = {
    schema:{
        response:{
            200:commonResponse,
        },
        querystring: {
            data: { type: 'string' }
        }
    },
    handler:getMethodAccess
}

const trackAccessPost  = {
    schema:{
        response:{
            200:commonResponse,
        },
        body: {
            type: 'object',
            properties: {
                data: { type: 'string' }
            }
        }
    },
    handler:postMethodAccess
}

function getRoutes(fastify, options, done) {

    
    //构建埋点需要的参数对象， 生成logID 返回前端 ，通过消息消费 查询用户信息 入库
    fastify.get('/track/log-server/access', trackAccessGet);

//埋点统计-post
//构建埋点需要的参数对象， 生成logID 返回前端 ，通过消息消费 查询用户信息 入库
    fastify.post('/track/log-server/access', trackAccessPost);
    done();
}


module.exports = getRoutes;